(function(){
    let params = dealUrl(location.href);
    $("nav a:eq(2)")
		.html(params.title)
		.attr(
			"href",
			`../pages/brandList.html?title=${params.title}&brandtitleid=${params.brandtitleid}`
		);
    $.ajax({
        url:`http://chst.vip:1234/api/getbrandproductlist?brandtitleid=${params.brandtitleid}`
    }).then(res=>{
        render(res.result)

    })

    function render(res) {
		let str = res.reduce((value, item) => {
			return (
				value +
				`
				<a href="../pages/productList.html?categoryid=${item.categoryId}&productid=${item.productId}&title=${params.title}">
				<li>
                ${item.productImg}
                <div class="fr">
                 <h4>${item.productName}</h4>
                 <p class="price">${item.productPrice}</p>
                 <p class="other">
                 <span class="price-num">${item.productQuote}</span>
                 <em>
                     <i class="iconfont">&#xe602;</i>
                     <span class="comments">${item.productCom}</span>
                 </em>
                     </p>
                    </div>
                </li>
				</a>
            
				`
			);
		}, "");
		$(".info").html(str);
	}
})()